// 用户地址模型
const { Address } = require('../../../models/address');
// 统一数据返回类
const { DataReturn } = require('../../../common/returnclass');

module.exports = async (req, res) => {
	// 地址id
	let { _id } = req.fields;
	console.log(req.fields);

	// 更新地址信息
	Address.updateOne({_id}, req.fields)
	.then(()=>{
		DataReturn.getData(res,200,[],'更新地址成功')
	}).catch(()=>{
		DataReturn.getData(res,400,[],'更新地址失败')
	})

}